<template>
<div>
    <!-- <headerNavigation :jump="1"></headerNavigation> -->
    <labelNavigation :Xuexidata="semesterName"></labelNavigation>
    <button class="return" @click="back()">
      <i class="el-icon-arrow-left"></i>
      返回
    </button>
    <div class="photoCountainer">
    <div class="background">
        <img src="@/assets/imagesbackground/Honour.png" >
    </div>
        <img class="studenthonour1" src="../../assets/images/StudentHonour.png">
        <img class="studenthonour2" src="../../assets/images/StudentHonour.png">
        <img class="studenthonour3" src="../../assets/images/StudentHonour.png">
        <div class="assessed">
            <img :src="sealsList[0]" class="sealimg1" />
            <img :src="sealsList[1]" class="sealimg2" />
            <img :src="sealsList[2]" class="sealimg3" />  
        </div>
    <div class="day">
        <!-- <span>2022 6 2</span> -->
        <!-- <span>2022 6 2</span> -->
        <!-- <span>2022 6 2</span> -->
    </div>
    <!-- 按钮 -->
    <div class="btnCountainer">
        <button class="btn" @click="next">下一模块</button>
    </div>
    </div>
    <!-- <footerNavigation></footerNavigation> -->
</div>
</template>
<script>
// import headerNavigation from "../components/background/headerNavigation"
import labelNavigation from "../components/background/labelNavigation"
// import footerNavigation from "../components/background/footerNavigation"
import {studentbsogsoAPI} from "../../api/make/make"
import module from "../../allurlimg/img";
export default {
    components:{
        // headerNavigation,
        labelNavigation,
        // footerNavigation
    },
    data() {
        return {
            semesterName:"" ,
            sealsList:[] ,
            honour:""
        }
    },
 mounted(){
     window.onbeforeunload = function (e) { 
    var storage = window.localStorage; 
    // storage.clear() 
    }
  },
   async created(){
    //学期
    let semesterName=this.$route.query.semesterName
    console.log("33333",this.$route.query.semesterName)
    if(semesterName!=undefined){
    sessionStorage.setItem("semesterName",this.$route.query.semesterName)
    this.semesterName=sessionStorage.getItem("semesterName")
    }
    else{
    this.semesterName=sessionStorage.getItem("semesterName")
    }
    //存储id
    let studentId = this.$route.params.stuId;
    let growthId = this.$route.params.growthId;
    if (studentId != undefined) {
      sessionStorage.setItem("studentId", this.$route.params.stuId);
      this.studentId = sessionStorage.getItem("studentId");
    } else {
      this.studentId = sessionStorage.getItem("studentId");
    }
    if (growthId != undefined) {
      sessionStorage.setItem("growthId", this.$route.params.growthId);
      this.growthId = sessionStorage.getItem("growthId");
    } else {
      this.growthId = sessionStorage.getItem("growthId");
    }
    const res = await studentbsogsoAPI({studentId: this.studentId,growthId: this.growthId});
    console.log("111",res)
    this.honour=res.data['8']
    if(this.honour['honour1']===1){
        this.sealsList.push(module.host + res.data.seals.励志少年专用章)
    }
    if(this.honour['honour2']===1){
         this.sealsList.push(module.host + res.data.seals.卓越少年专用章)
    }
    if(this.honour['honour3']===1){
        this.sealsList.push(module.host + res.data.seals.文明学生专用章)
    }
    if(this.honour['honour4']===1){
         this.sealsList.push(module.host + res.data.seals.梦想领袖专用章)
    }
    if(this.honour['honour5']===1){
         this.sealsList.push(module.host + res.data.seals.模范学生专用章)
    }
    },
    methods:{
        back() {
            this.$router.go(-1)
        },
         next() {
            this.$router.push("/doGrowth/semestersum");
       },
    }
}
</script>

<style>
.background{
    position: relative;
    margin-top: 3.125rem;
}
/* 荣誉奖 */
.studenthonour1{
    position: absolute;
    z-index: 2;
    height: 7rem !important;
    width: 17.25rem !important;
    left: 43%; top: 35%;
}
.studenthonour2{
    position: absolute;
    z-index: 2;
    height: 7rem !important;
    width: 17.25rem !important;
    left: 43%; top: 50.5%;
}
.studenthonour3{
    position: absolute;
    z-index: 2;
    height: 7rem !important;
    width: 17.25rem !important;
    left: 43%; top: 65%;
}
/* 日期 */
.day{
    display: flex;
    position: absolute;
    z-index: 3;
    width: 4.375rem;
    flex-wrap: wrap;
    top: 43.5%;
    right: 43%;
    height: 16.875rem;
    align-content: space-between;
    font-size: .625rem;
}
/* 被评为 */
.assessed{
    display: flex;
    width: 6.25rem;
    flex-wrap: wrap;
    position: absolute;
    z-index: 3;
    top: 39%;
    right: 50%;
    height: 16.875rem;
    align-content: space-between;
}

/* 背景图片 */
.background img{
  height: 34rem;
  width: 24rem;
  display: flex;
  margin: 0 auto;
}
/* 按钮 */
.btnCountainer{
    display: flex;
    justify-content: center;
    margin-top: 4.375rem;
}
.btn{
   background-color: rgba(124, 0, 0, 1);
   color: aliceblue;
   border: .0625rem solid rgba(187, 187, 187, 1);
   width: 9.375rem;
   height: 2.8125rem;
   font-size: 1.125rem;
}
.return {
  font-size: 1.125rem;
  text-align: center;
  position: relative;
  left: 27.5rem;
  border: 0rem;
  background: #fff;
}
.sealimg1{
 position:absolute;
 z-index:4;
 width:5rem;
 height: 2rem;
 left:5.2rem;
}
.sealimg2{
position:absolute;
z-index:4;
width:5rem;
height: 2rem;
top:9rem;
left:5.2rem;
}

.sealimg3{
 position:absolute;
 z-index:4;
 width:4rem;
 height: 1.5rem;
 top:18.5rem;
 left:5.2rem;
}

</style>